package com.example.demo.service;

import com.example.demo.domain.Event;
import com.example.demo.mapper.EventMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class EventServiceImpl implements EventService{
    @Autowired
    private EventMapper eventMapper;

    @Override
    public int addEvent(Event event) {
        return eventMapper.InsertEvent(event);
    }

    @Override
    public int deleteEvent(Integer id) {
        return eventMapper.DeleteEvent(id);
    }

    @Override
    public int updateEvent(Event event) {
        return eventMapper.UpdateEvent(event);
    }

    @Override
    public Event selectEvent(Integer id) {
        return eventMapper.SelectEvent(id);
    }

    @Override
    public List<Event> selectAll() {
        return eventMapper.SelectAll();
    }
}
